/**
 * @Author: 肖科
 * @Date: 2019/11/13
 * @Last Modified by:   肖科
 * @Last Modified time: 2019-11-13 09:45:00
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 品牌 - 下拉框
export const getPinpSelect = params => axios.get(`/api/basedata/vehicleProduct/brandsqueryall`, { params });

// 车系 - 下拉框(根据品牌的id)
export const getChexSelect = (brandId, params) =>
  axios.get(`/api/basedata/vehicleProduct/brandsdict/${brandId}/seriessdict`, {
    params
  });
//  根据车系查询信息
export const getVehicle = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repair/case/findVehicle`, { params });

//  主页面信息查询
export const queryCase = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repair/case/findRepairCase`, { params });

// 维修案例新增
export const addSave = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/repair/case/addSave`, params);

// 维修案例编辑
export const editSave = (params, id) => axios.post(`${SERVER.DMSCLOUD_REPAIR}/repair/case/edit/${id}`, params);

// 维修案例删除
export const deleteSave = (ID, params) => axios.post(`${SERVER.DMSCLOUD_REPAIR}/repair/case/delete/${ID}`, params);

// 维修案例上报
export const uploadCase = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/repair/case/report/${params.ID}`, params);

// 维修案例取消上报
export const cancelUpload = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/repair/case/cancel/${params.ID}`, params);

// 编辑页面查询
export const queryCaseDetailed = id => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repair/case/searach/${id}`, {});
